#!/usr/bin/perl -w

use 5.010;

sub divisors {
my $number = shift;
my @divisors = ();
foreach my $divisor ( 2 .. $number/2 ) {

   if ( ${number}%${divisor} == 0 ) {
    push @divisors, $divisor;
   }
 }
return @divisors;
}
my $favorite = 33;

$hum = $ARGV[0];
say "Number is $hum";

my @tiny;

given ( $hum ) {
 when ( $_ ~~ /\d/ ) {
 @array = &divisors ($hum);
 if ( @array ~~ @tiny ) {
 say "Number is simple"; 
 break;
 }
 say "divisors is @array";
 continue;
 }
 when ( ${hum}%2 == 0) {
 say "$hum is chetnoe";
 continue;
 }
 when ( ${hum}%2 != 0) {
 say "$hum is nechetnoe";
 continue;
 }
 when ( $hum ~~ /^$/ ) {
 say "You don't enter a number";
 }
 when ( $hum ~~ /\D/ ) {
 say "$hum is not a number";
 }
 when ( ${hum}%${favorite} == 0) {
 say "$hum is my favorite number";
 }
}
